from PyGMO import *
from parity_measurement_problems import *

prob = PulseProblem(constant_pulse, bounds=((0.4,0.7),))
#prob = TestProblem(bounds=((0.0,20.0),))
algo = algorithm.pso_gen(gen = 1)
isl = island(algo, prob, 20)
for i in range(30):
    isl.evolve(1)
    print isl.population.champion.f
    print isl.population.champion.x